package org.dtrd.modules.flup.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.flup.entity.bean.FlupTemplateProjectDetail;


/**
 * <p>
 * 复诊模版项目
 * </p>
 *
 * @author QR
 * @since 2021-12-21
 */
@Getter
@Setter
@TableName("dtrd_ent_rd_flup_template_project")
public class DtrdEntRdFlupTemplateProject {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    /**
     * 机构编码
     */
    @TableField("org_code")
    private String orgCode;

    /**
     * 复诊模版内容名称
     */
    @TableField("template_project_name")
    private String templateProjectName;

    /**
     * 复诊模版内容描述
     */
    @TableField("template_project_desc")
    private String templateProjectDesc;

    /**
     * 内容是否固定, 即不可修改, 1-是, 0否
     */
    @TableField("is_fixed")
    private Integer isFixed;

    /**
     * 顺序
     */
    @TableField("order_num")
    private Integer orderNum;

    @TableField("create_time")
    private Date createTime;

    @TableField("update_time")
    private Date updateTime;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    public DtrdEntRdFlupTemplateProject init() {
        createTime = new Date();
        isDel = 0;
        return this;
    }

    public DtrdEntRdFlupTemplateProject parseFromDto(FlupTemplateProjectDetail dto) {
        dataId = dto.getDataId();
        orgCode = dto.getOrgCode();
        templateProjectName = dto.getTemplateProjectName();
        templateProjectDesc = dto.getTemplateProjectDesc();
        isFixed = dto.getIsFixed();
        orderNum = dto.getOrderNum();
        return this;
    }


}
